package kr.hkit.androidcomplete03.ch25;

import kr.hkit.androidcomplete03.R;
import kr.hkit.androidcomplete03.ch23.FrameAni;
import kr.hkit.androidcomplete03.ch26.EWProvider;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class Ch25Main extends ListActivity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.ch25, android.R.layout.simple_list_item_1);
		setListAdapter(adapter);
	}
	
	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		super.onListItemClick(l, v, position, id);
		
		Intent intent = null;
		
		switch(position){
		
		case 0:
			intent = new Intent(this, SDCardEx.class);
			break;
			
		case 1:
			intent = new Intent(this, FileExplorer.class);
			break;
			
		case 2:
			intent = new Intent(this, SQLiteTest.class);
			break;
			
		case 3:
			intent = new Intent(this, EWProvider.class);
			break;
		}
		startActivity(intent);
	}
}
